package com.example.coffeesystem.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor//无参构造
@AllArgsConstructor//全参构造
public class Result {

    //相应给前端是否成功的标识
    private boolean flag;
    //响应信息
    private String message;
    //响应数据
    private Object data;

    public Result(boolean b, String message) {
    }

    //响应成功的结果
    public static Result success(String message, Object data){
        return new Result(true,message,data);
    }
    //响应失败的结果
    public static Result fail(String message){
        return new  Result(false,message);
    }

}
